﻿using System;
using System.Collections.Generic;
using System.Text;
using Cashier_Utils;

namespace Cashier_Model
{
    [TableAttribute(Tablename="goods")]
    public class Goods: BaseModel
    {
        private Int64 id;

        [TableAttribute(Columnname="id", Columntype="bigint", Iskey=true, Iscondition=true, Fieldothername="g", Isdeletefield=true)]
        public Int64 Id
        {
            get { return id; }
            set { id = value; }
        }

        private String code;

        [TableAttribute(Columnname = "code", Columntype = "varchar", Iscondition = true, Fieldothername = "g", Isupdatefield = true)]
        public String Code
        {
            get { return code; }
            set { code = value; }
        }

        private String barcode;

        [TableAttribute(Columnname = "barcode", Columntype = "varchar", Iscondition = true, Fieldothername = "g", Isupdatefield = true)]
        public String Barcode
        {
            get { return barcode; }
            set { barcode = value; }
        }

        private String name;

        [TableAttribute(Columnname="name", Columntype="varchar", Iscondition = true, Conditiontype = ConditionType.LIKE, Fieldothername = "g", Isupdatefield=true)]
        public String Name
        {
            get { return name; }
            set { name = value; }
        }

        private Int64 categoryid;

        [TableAttribute(Columnname = "category_id", Columntype = "bigint", Iscondition = true, Isupdatefield = true)]
        public Int64 Categoryid
        {
            get { return categoryid; }
            set { categoryid = value; }
        }

        private String norm;

        [TableAttribute(Columnname="norm", Columntype="varchar", Isupdatefield=true)]
        public String Norm
        {
            get { return norm; }
            set { norm = value; }
        }

        private Decimal pricecost;

        [TableAttribute(Columnname = "price_cost", Columntype = "decimal", Isupdatefield = true)]
        public Decimal Pricecost
        {
            get { return pricecost; }
            set { pricecost = value; }
        }

        private Decimal pricesale;

        [TableAttribute(Columnname = "price_sale", Columntype = "decimal", Isupdatefield = true)]
        public Decimal Pricesale
        {
            get { return pricesale; }
            set { pricesale = value; }
        }

        private Decimal discount;

        [TableAttribute(Columnname = "discount", Columntype = "decimal", Iscondition = true, Conditiontype=ConditionType.GREATER, Compareto=0, Fieldothername = "g", Isupdatefield = true)]
        public Decimal Discount
        {
            get { return discount; }
            set { discount = value; }
        }

        private Boolean? isvipprice = null;

        [TableAttribute(Columnname = "is_vipprice", Columntype = "boolean", Iscondition = true, Fieldothername = "g", Isupdatefield = true)]
        public Boolean? Isvipprice
        {
            get { return isvipprice; }
            set { isvipprice = value; }
        }

        private String companyname;

        [TableAttribute(Columnname = "company_name", Columntype="varchar", Isupdatefield=true)]
        public String Companyname
        {
            get { return companyname; }
            set { companyname = value; }
        }

        private String note;

        [TableAttribute(Columnname="note", Columntype="varchar", Isupdatefield=true)]
        public String Note
        {
            get { return note; }
            set { note = value; }
        }

        private Int32 stock;

        [TableAttribute(Columnname = "stock", Columntype = "int", Iscondition = true, Conditiontype=ConditionType.LESS, Fieldothername = "g", Isupdatefield = true)]
        public Int32 Stock
        {
            get { return stock; }
            set { stock = value; }
        }

        private DateTime lasttime;

        [TableAttribute(Columnname = "lasttime", Columntype="datetime")]
        public DateTime Lasttime
        {
            get { return lasttime; }
            set { lasttime = value; }
        }

        private String categoryname;

        [TableAttribute(Columnname = "categoryname", Columntype = "varchar")]
        public String Categoryname
        {
            get { return categoryname; }
            set { categoryname = value; }
        }
    }
}
